<!--{template common/header_simple_start}-->
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
<link href="admin/images/app.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<script src="admin/scripts/admin.js?{VERHASH}"></script>
<style>
html,body{
	overflow:hidden;
	background:#FBFBFB;
}
.bs-left-container{
	width:150px;
}
.bs-main-container{
	margin-left:150px;
	overflow:auto;
}

</style>
<!--{template common/header_simple_end}-->
<nav class="navbar navbar-default bs-navbar-default navbar-fixed-top" role="navigation" style="margin:0">
      <!--{template top}--> 
</nav>
<div class="bs-container clearfix">
  <div class="bs-left-container  clearfix">
  	<ul class="nav nav-pills nav-stacked nav-pills-leftguide" style="margin:10px 0;">
   			 
               <li <!--{if $group=='0' && !$org}-->class="active"<!--{/if}-->>
              		<a href="{BASESCRIPT}?mod=$mod&op=default&group=0">通用应用</a>
              </li>
              <li <!--{if $group=='-1' && !$org}-->class="active"<!--{/if}-->>
              		<a href="{BASESCRIPT}?mod=$mod&op=default&group=-1">游客应用</a>
              </li>
              
             <li <!--{if $group=='1' && !$org}-->class="active"<!--{/if}-->>
              		<a href="{BASESCRIPT}?mod=$mod&op=default&group=1">普通成员应用</a>
              </li>
              <li <!--{if $group=='3' && !$org}-->class="active"<!--{/if}-->>
              		<a href="{BASESCRIPT}?mod=$mod&op=default&group=3">系统管理员应用</a>
              </li>
              <li <!--{if $group=='2' && !$org}-->class="active"<!--{/if}-->>
              		<a href="{BASESCRIPT}?mod=$mod&op=default&group=2">部门管理员应用</a>
              </li>
              
              <li class="dropdown <!--{if $org}-->active<!--{/if}-->">
                  <input id="sel_orgid"  type="hidden"   value="$depid" />
                  <a href="#" type="button" id="orgid_Menu" class="dropdown-toggle" data-toggle="dropdown">
                    $orgpath <span class="caret"></span>
                  </a>
                  <div id="orgid_dropdown_menu" class="dropdown-menu org-sel-box" role="menu" aria-labelledby="orgid_Menu">
                       <iframe name="orgid_iframe" class="org-sel-box-iframe" src="index.php?mod=system&op=orgtree&ctrlid=orgid&nouser=1" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="100%" allowtransparency="true" ></iframe>
                  </div>
              </li>
             
            </ul>
    
  </div>
  <div class="left-drager">
     <div class="left-drager-op"><div class="left-drager-sub"></div></div>
  </div>
  <div class="bs-main-container">
        <div class="main-header" style="padding:0 10px;">
            <ul class="nav nav-pills nav-pills-bottomguide">
                  <strong class="pull-left">筛选:&nbsp;&nbsp;</strong>
                  <li <!--{if $position==0}-->class="active"<!--{/if}-->><a href="{BASESCRIPT}?mod=app&op=default&group=$group&depid=$depid&position=0">全部位置</a></li>
                  <li <!--{if $position==2}-->class="active"<!--{/if}-->><a href="{BASESCRIPT}?mod=app&op=default&group=$group&depid=$depid&position=2">桌面</a></li>
                  <li <!--{if $position==1}-->class="active"<!--{/if}-->><a href="{BASESCRIPT}?mod=app&op=default&group=$group&depid=$depid&position=1">开始菜单</a></li>
                  <li <!--{if $position==3}-->class="active"<!--{/if}-->><a href="{BASESCRIPT}?mod=app&op=default&group=$group&depid=$depid&position=3">任务栏</a></li>
                  <li class="pull-right" style="padding-top:3px;">
                        <form name="search" action="{BASESCRIPT}" method="get">
                        <input type="hidden" name="mod" value="$mod" />
                        <input type="hidden" name="op" value="$op" />
                        <input type="hidden" name="group" value="$group" />
                        <input type="hidden" name="depid" value="$depid" />
                        <div class="input-group input-group-sm" style="width:150px;">
                        <input name="keyword"  type="text" value="$keyword" class="form-control" placeholder="应用名称">
                        <a href="javascript:;" class="input-group-addon" onclick="this.parentNode.parentNode.submit()"><i class="glyphicon glyphicon-search"></i></a>
                        </div>
                        </form>
                  </li>
            </ul>
        </div>
        
        <div class="main-content clearfix" style="border-top:1px solid #FFF;">
         <form id="appform" name="appform" class="form-horizontal" action="{BASESCRIPT}?mod=app&op=default" method="post" >
            <input type="hidden" name="appsubmit" value="true" />
            <input type="hidden" name="formhash" value="{FORMHASH}" />
           <table class="table table-hover" >
                    <thead>
                      <th width="50">排序</th>
                      <th>应用名称</th>
                      <th>默认位置</th>
                      <th><label class="checkbox checkbox-inline"><input type="checkbox" name="chkall" id="chkall" onclick="checkAll('prefix', this.form, 'notdelete')"><strong>不允许删除</strong></label></th>
                    </thead>
                 <!--{loop $list $value}-->
                    <tr>
                     <!-- <td width="20"><input type="checkbox" name="appids[]" value="$value[appid]"  /></td>-->
                      <td width="40"><input type="text" class="form-control input-sm" name="disp[{$value[appid]}]" value="$value[disp]" style="width:45px;" /></td>
                      <td><a href="$value[appurl]"><img src="$value[appico]" />$value[appname]</a></td>
                      <td>
                        <select name="position[{$value[appid]}]" class="form-control input-sm" style="width:120px">
                        <!--{loop $positionarr $key $value1}-->
                            <option  value="$key"  <!--{if $value[position]==$key}-->selected="selected"<!--{/if}-->>$value1</option>
                       <!--{/loop}-->
                       </select>
                      </td>
                      <td>
                         <label class="checkbox checkbox-inline"><input type="checkbox" name="notdelete[{$value[appid]}]" value="1" <!--{if $value[notdelete]>0}-->checked<!--{/if}-->></label>&nbsp;<button id="clear_{$value['appid']}" style="width:100px;" class="btn btn-link" data-loading-text="清除中..." type="button" title="从所有已安装此应用的用户中清除" onclick="clearAppFromUser('$value[appid]');return false">清除</button>
                      </td>
                    </tr>
                 <!--{/loop}-->
                 <tr>
                     <th valign="middle" ><input type="submit" class="btn btn-primary" value="保存设置" /></th>
                     <th colspan="3"> $multi</th>
                 </tr>
                </table>
              </form>
             <div class="tip" style="margin:10px;color:#333;text-shadow:1px 1px 1px #FFF;line-height:1.8">
                <div class="alert alert-warning">
                    <button type="button" class="close" data-dismiss="alert">&times;</button>
                    <h5>提示信息</h5>
                    <ul>
                        <li>排序：值越大越靠后</li>
                        <li>可以通过默认位置设置应用默认安装在用户的桌面、开始菜单、或者任务栏上</li>
                        <li>安装在桌面或者任务栏上的应用默认也会出现在开始菜单上</li>
                        <li>机构部门应用只列出此机构或部门的专有应用，成员应用内不列出机构或部门的专有应用</li>
                        <li>通用应用是指全部用户都可以使用的应用，游客应用、管理员应用和成员应用中不列出通用应用</li>
                        <li>用户只要删除开始菜单里的应用才会真正卸载此应用，只删除桌面或任务栏上的应用不会卸载此应用</li>
                        <li>对于隐藏的应用（应用编辑页“显示图标项”设置为隐藏时），这里也必须设置默认位置，才能默认给用户安装（虽然用户的相应位置并没有显示此应用）</li>
                        <li>清除：从所有已经安装此应用的用户桌面中清除此应用。对于不允许删除的应用，用户登录会再次添加</li>
                    </ul>
                </div>
            </div>
        </div>
       
      
   </div>
</div>
   
<script type="text/javascript">  
jQuery('.left-drager').leftDrager_layout();
var selorg={};

//添加
selorg.add=function(ctrlid,vals){
	if(vals[0].orgid && vals[0].orgid!='other'){
		jQuery('#'+ctrlid+'_Menu').html(vals[0].path+' <span class="caret"></span>');
		window.location.href='{ADMINSCRIPT}?mod=app&op=default&depid='+vals[0].orgid;
	}
}
		

function clearAppFromUser(appid,i){
	if(!i) i=0;
	var el=jQuery('#clear_'+appid);
	if(i==0) el.button('loading');
	jQuery.getJSON('{ADMINSCRIPT}?mod=app&op=default&do=clear&appid='+appid+'&i='+i,function(json){
		if(json.error){
			el.html(json.error);
			window.setTimeout(function(){el.html('清除');el.button('reset');},1000);
		}else if(json.msg=='continue'){
			clearAppFromUser(appid,json.start);
		}else if(json.msg=='success'){
			window.setTimeout(function(){el.html('清除成功');},1000);
			window.setTimeout(function(){el.html('清除');el.button('reset');},2000);
		}
	});
}

</script>
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
<!--{template common/footer_simple}-->
